package chamber.zero.dna;

import com.google.common.collect.FluentIterable;
import com.google.common.io.LineProcessor;
import com.google.inject.Inject;
import util.Counter;
import util.StringIterable;

import java.io.IOException;
import java.util.Map;

/**
 * Created by Gerardo on 12/4/13.
 */
public class SequenceMapper implements LineProcessor<Map<Chromosome, Counter>> {
    private ToNucleotideFunction toNucleotide;
    private ToChromosomeFunction toChromosome;

    @Inject
    public SequenceMapper(ToNucleotideFunction toNucleotide) {
        this.toNucleotide = toNucleotide;
    }

    @Override
    public boolean processLine(final String line) throws IOException {
        FluentIterable<Chromosome> chromosomes = FluentIterable.from(StringIterable.of(line)).transform(toNucleotide).limit(line.length() - 6).transform(toChromosome);
        return false;
    }

    @Override
    public Map getResult() {
        return null;
    }
}
